﻿using System.Data.SqlClient; 
using System.Data.Common;

namespace Dapper_Console.Common.Infrastructure
{
    public static partial class Database
    {
        /// <summary>
        /// 主数据库（写）
        /// </summary>
        public static string MASTER_LOCAL_CONNECTION = string.Empty;

        /// <summary>
        /// 从数据库（读）
        /// </summary>
        public static string SLAVE_LOCAL_CONNECTION = string.Empty;

        /// <summary>
        /// 创建数据库连接
        /// </summary>
        /// <param name="connString"></param>
        /// <returns></returns>
        public static DbConnection Connection(string connString)
        {
            DbConnection conn = new SqlConnection(connString);
          //DbConnection conn = new MySqlConnection(connString);
            return conn;
        }
    }
}
